package com.mijie.homi.search.util;
import java.io.IOException;
import java.io.Reader;
import java.util.List;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.logicalcobwebs.proxool.ProxoolException;
import org.logicalcobwebs.proxool.configuration.JAXPConfigurator;

import com.mijie.homi.search.api.UserSearchApi;
import com.mijie.homi.search.api.proxoolController;

public class ibtsT {

	/**
	 * @param args
	 * @throws IOException 
	 */
 
	    public static void main(String[] args) throws IOException {
	    	iniProxool();
	        
	            String resource = "com/mijie/homi/search/util/ibatiascfg.xml";
	            Reader reader;

	            reader = Resources.getResourceAsReader(resource);

	            SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder()
	                    .build(reader);
	            SqlSession sqlSession = sqlSessionFactory.openSession();
	         List li=   sqlSession.selectList("getRecently100", 9999999);
//	            StudentDao studentDao =sqlSession.getMapper(StudentDao.class);
//	            Student st = studentDao.getstudent(1);
	            System.out.println( li.size());
	            sqlSession.close();
	       

	}
	    
	    
	    public static void iniProxool() {
			try {
				JAXPConfigurator
						.configure(
								UserSearchApi.	PROXOOL_XML,
								false);
			} catch (ProxoolException e1) {

				e1.printStackTrace();
			}
			proxoolController.getnew();
		}

}
